/*
 * PlaylistPopupMenu.java
 *
 * Created on April 8, 2006, 11:40 AM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package com.bff.slimserver.musicjukebox.ui.components;

import com.bff.slimserver.musicjukebox.lib.actions.DisplaySongInfoAction;
import com.bff.slimserver.musicjukebox.lib.actions.PlaylistAddSongAction;
import javax.swing.JFrame;
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import org.bff.slimserver.SlimPlaylist;
import org.bff.slimserver.musicobjects.SlimPlaylistItem;

/**
 *
 * @author Bill
 */
public class SonglistPopupMenu extends JPopupMenu {
    private SlimPlaylist playlist;
    
    private JMenuItem addToCurrentPlaylistMenuItem;
    private JMenuItem displaySongInfoMenuItem;
    
    private SlimPlaylistItem song;
    private JFrame parent;
    
    /** Creates a new instance of PlaylistPopupMenu */
    public SonglistPopupMenu(JFrame parent, SlimPlaylist playlist, SlimPlaylistItem song) {
        this.playlist = playlist;
        this.song = song;
        this.parent = parent;
        createMenuItems();       
    }
    
    private void createMenuItems() {
        //current playlist
        addToCurrentPlaylistMenuItem = new JMenuItem(new PlaylistAddSongAction(playlist, song));
        addToCurrentPlaylistMenuItem.setText("Add To Current Playlist");
        add(addToCurrentPlaylistMenuItem);

        //song info
        displaySongInfoMenuItem = new JMenuItem(new DisplaySongInfoAction(parent, song));       
        add(displaySongInfoMenuItem);
    }
    
}
